package com.bolt.report.business.modules.field.entity;

import com.bolt.support.spring.jpa.entity.PersistableEntity;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.FieldDefaults;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Auto Generate Javadoc
 *
 * @author 日期:2021-11-17 11:40:21
 **/
@Access(AccessType.FIELD)
@Entity
@Table(name = "bolt_report_db_field")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Getter
@Setter
@EqualsAndHashCode
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ReportDbFieldEntity extends PersistableEntity<String> {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @Id
    @GeneratedValue(generator = "hibernate-uuid")
    @GenericGenerator(name = "hibernate-uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @EqualsAndHashCode.Include
    private String id;

    /**
     * 数据集ID
     */
    @Column(name = "report_db_id", insertable = false, updatable = false)
    @EqualsAndHashCode.Include
    private String reportDbId;

    /**
     * 字段名
     */
    @Column(name = "field_name", length = 80)
    private String fieldName;


    /**
     * 字段类型
     */
    @Column(name = "field_type", length = 80)
    private String fieldType;

    /**
     * 字段文本
     */
    @Column(name = "field_text", length = 32)
    private String fieldText;

    /**
     * 字段表达式
     */
    @Column(name = "field_expr", length = 50)
    private String fieldExpr;

    /**
     * 排序
     */
    @Column(name = "order_num", length = 3)
    private Integer orderNum;


    @Column(name = "order_type", length = 2)
    private Integer orderType;
}